Replace file_name with filename in Effect kwargs #147
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
file_name
as a kwarg does seem to work, but it behaves differently fromfilename
. In particular, withfile_name
the absolute path of the file is used, and withfilename
the relative path (or well, the actual given path). I have not investigated why.The reason for harmonizing is that when generating FITS keywords, we'd like to have them to have the filename as it was given by the user or the irdb, not the absolute path where this file happens to be on this particular installation.
Do we perhaps want to force
file_name
?E.g. put an assert in
data_container.py
instead of a fallback: https://github.com/AstarVienna/ScopeSim/blob/36df1767c2b8143a199d085cdf1af181660c058a/scopesim/effects/data_container.py#L63-L64to
or maybe a deprecation notice would be better.
But that is a ScopeSim problem; this PR is just making the IRDB consistent.